﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CXMLStudioIDE.Common.Entities
{
    public class EntityVersion
    {
        private int _EntityVersionID;
        private string _MajorVersion;
        private string _MinorVersion;
        private string _DataValuesVersion;

        public EntityVersion()
        { 
        
        }
        public EntityVersion(int inEntityVersionID,string inMajorVersion, string inMinorVersion, string inDataValuesVersion)
        {
            this._EntityVersionID = inEntityVersionID;
            this._MajorVersion = inMajorVersion;
            this._MinorVersion = inMinorVersion;
            this._DataValuesVersion = inDataValuesVersion;
        }
        public int EntityVersionID
        {
            get { return _EntityVersionID; }
            set { _EntityVersionID = value; }
        }
        public string MinorVersion
        {
            get { return _MinorVersion; }
            set { _MinorVersion = value; }
        }

        public string MajorVersion
        {
            get { return _MajorVersion; }
            set { _MajorVersion = value; }
        }

        public string DataValuesVersion
        {
            get { return _DataValuesVersion; }
            set { _DataValuesVersion = value; }
        }
        public string FullVersion
        {
            get { return _MajorVersion + "." + _MinorVersion + "." + _DataValuesVersion; }
            set
            {
                EntityVersion ev = Common.ParseEntityVersion(value);
                if (ev != null)
                {
                    _MajorVersion = ev._MajorVersion;
                    _MinorVersion = ev.MinorVersion;
                    _DataValuesVersion = ev.DataValuesVersion;
                }
            }
        }
    }
}
